//
//  ContractDetailModel.swift
//  Health-Doctor
//
//  Created by 2snail_swk on 2022/4/20.
//  Copyright © 2022 掌上卫健. All rights reserved.
//

import HandyJSON

class ContractDetailModel: HandyJSON {
    //签约记录ID，是字符串类型，别乱改
    var contractId = ""
    //联系人姓名
    var contactName = ""
    //联系人电话
    var contactPhone = ""
    //联系人与本人的关系(枚举)
    var contactRelationship = 0
    //联系人与本人的关系(文字)
    var contactRelationshipStr = ""
    //服务项目
    //已签约的服务项
    var packList:[TeamSpkgModel] = []
    //签约医生名称
    public var signUserName = ""
    //签约描述
    public var desc = ""
    
    //签约生效时间
    var serviceStartTime = ""
    //签约失效时间
    var serviceEndTime = ""
    //签约的时间
    var signedTime = ""
    //签约凭证照片路径
    var signingCertificateUrl = ""
    //电子签名照路径
    var autographUrl = ""
    //身份证正面
    var photoFace = ""
    //身份证反面
    var photoBack = ""
    
    var signTeam:TeamModel?
    //签约年限（1年，2年。。。默认1年）
    var timeType = 1
    //签约状态
    var signStatus = 0
    //新责任医生
    public var agentUserName = ""
    
    required init(){}
    func mapping(mapper: HelpingMapper) {
        // 把id转换为json数据里的key：id，friendName转化为读json数据里的friend字典中的name字段。
        mapper <<< self.desc <-- "description"
    }
   
    
    //模型转换
//    public func getTaskSignModel(rhrId:String)->TaskSignModel{
//        let model = self
//        let signModel = TaskSignModel()
//        signModel.contractId = model.contractId
//        signModel.residentHealthRecordId = rhrId
//        
//        signModel.signedTime = model.serviceEndTime
//        signModel.timeType = "\(model.timeType)"
//        signModel.teamId = model.signTeam?.teamId ?? ""
//        signModel.teamName = model.signTeam?.name ?? ""
//        signModel.signStatus = model.signStatus
//        signModel.serviceEndTime = model.serviceEndTime
//        signModel.serviceStartTime = model.serviceStartTime
//        return signModel
//    }
}
